/*
 * mana (compiler)
 * Copyright (c) 2014 Shun Moriya <shun@mnu.sakura.ne.jp>
 *
 * This software is provided 'as-is', without any express or implied
 * warranty. In no event will the authors be held liable for any damages
 * arising from the use of this software.
 *
 * Permission is granted to anyone to use this software for any purpose,
 * including commercial applications, and to alter it and redistribute it
 * freely, subject to the following restrictions:
 *
 *  1. The origin of this software must not be misrepresented; you must not
 *     claim that you wrote the original software. If you use this software
 *     in a product, an acknowledgment in the product documentation would be
 *     appreciated but is not required.
 *
 *  2. Altered source versions must be plainly marked as such, and must not be
 *     misrepresented as being the original software.
 *
 *  3. This notice may not be removed or altered from any source
 *     distribution.
 */

/*!
 * @file
 * @brief	レジスタ割り当てに関するヘッダーファイル
 *
 * このファイルはレジスタ割り当てに関するヘッダーファイルです。
 *
 * @author	Shun Moriya <shun@mnu.sakura.ne.jp>
 */

#if !defined(___MANA_REGISTER_H___)
#define ___MANA_REGISTER_H___

#if !defined(___MANA_SYMBOL_H___)
#include "mana_symbol.h"
#endif

typedef struct mana_register_entity
{
	mana_symbol_entry* symbol;
	size_t address;
	char number;
}mana_register_entity;

extern void mana_register_initialzie(void);
extern void mana_register_finalize(void);
extern void mana_register_clear(void);

extern mana_register_entity* mana_register_find(mana_symbol_entry* symbol);

extern mana_register_entity* mana_register_allocate(mana_symbol_entry* symbol, size_t address);
extern void mana_register_release(mana_register_entity* entity);

#endif
